<template>
  <div>
    <h2>Home</h2>
    <h3>root</h3>
    {{ $store.state.num }}
    <button @click="$store.state.num = 10">set num</button>
    <br>
    <button @click="$store.commit('SET_NUM', 1)">set num</button>
    <hr>

    {{ $store.state.title }}
    <br>
    <input type="text" v-model="title">
  </div>
</template>
<script>

export default {
  computed: {
    title: {
      get() {
        return this.$store.state.title;
      },
      set(value) {
        // this.$store.state.title = value;
        this.$store.commit('SET_TITLE', value);
      },
    }
  }

}
</script>